home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / Xprof / xmeasure / tstmisc.c < prev    next >
C/C++ Source or Header  |  1994-08-01  |  21KB  |  1,104 lines

  1. /*==================================================================
  2.  *      File :          tstmisc.c
  3.  *      Package:        Xmeasure
  4.  * 
  5.  *      Author :        Aloke Gupta.
  6.  *
  7.  *  (C) Copyright 1992, Aloke Gupta.
  8.  *  All rights granted to University of Illinois Board of Regents.
  9.  *==================================================================*/
  10.  
  11. #include "perf.h"
  12.  
  13. typedef struct {
  14.     int do_a;        /* acceleration */
  15.     int do_t;        /* threshold     */
  16.     int acc_num;    /* numerator of acceleration term */
  17.     int acc_denom;    /* denominator of acceleration term */
  18.     int thresh;        /* threshold term */
  19. } PtrCntl;
  20.  
  21. typedef struct {
  22.     int timeout;
  23.     int interval;
  24.     int prefer_blanking;
  25.     int allow_exposures;
  26. } ScreenSaver;
  27.  
  28. /* Shared variables */
  29. static int     i;
  30. static Window  window;
  31. static PtrCntl ptr_cntl;
  32. static unsigned long    kbd_cntl_mask;
  33. static XKeyboardControl kbd_cntl;
  34. static XKeyboardState   kbd_state;
  35. static ScreenSaver    screensaver;
  36.  
  37. /* ====================================================================== */
  38. static unsigned long event_mask;
  39. XEvent event;
  40. int   SendEvent(xd, xp)      
  41. XD *xd;
  42. XParams *xp;
  43. {
  44.     for (i = 0; i < xp-> itns; i ++)
  45.     XSendEvent(xd->display, xd->window, True, event_mask, &event);
  46. }
  47.  
  48. int i_SendEvent(xd, xp)      
  49. XD *xd;
  50. XParams *xp;
  51. {
  52.     event_mask = ButtonPressMask;
  53.     event.type = ButtonPress;
  54. }
  55.  
  56. int c_SendEvent(xd, xp)      
  57. XD *xd;
  58. XParams *xp;
  59. { }
  60.  
  61. /* ====================================================================== */
  62.  
  63. int   GrabPointer(xd, xp)    
  64. XD *xd;
  65. XParams *xp;
  66. {
  67.     for (i = 0; i < xp-> itns; i ++)
  68.     XGrabPointer(xd->display, xd->window, True, ButtonPressMask, 
  69.             GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
  70. }
  71.  
  72. int i_GrabPointer(xd, xp)    
  73. XD *xd;
  74. XParams *xp;
  75. { }
  76.  
  77. int c_GrabPointer(xd, xp)    
  78. XD *xd;
  79. XParams *xp;
  80. {
  81.     XUngrabPointer(xd->display, CurrentTime);
  82. }
  83.  
  84. /* ====================================================================== */
  85.  
  86. int   UngrabPointer(xd, xp)  
  87. XD *xd;
  88. XParams *xp;
  89. {
  90.     for (i = 0; i < xp-> itns; i ++)
  91.     XUngrabPointer(xd->display, CurrentTime);
  92. }
  93.  
  94. int i_UngrabPointer(xd, xp)  
  95. XD *xd;
  96. XParams *xp;
  97. {}
  98.  
  99. int c_UngrabPointer(xd, xp)  
  100. XD *xd;
  101. XParams *xp;
  102. { }
  103.  
  104. /* ====================================================================== */
  105.  
  106. int   GrabButton(xd, xp)     
  107. XD *xd;
  108. XParams *xp;
  109. {
  110.     for (i = 0; i < xp-> itns; i ++)
  111.     XGrabButton(xd->display, AnyButton, AnyModifier, xd->window, True,
  112.             ButtonPressMask, GrabModeAsync, GrabModeAsync, None, None);
  113. }
  114.  
  115. int i_GrabButton(xd, xp)     
  116. XD *xd;
  117. XParams *xp;
  118. { }
  119.  
  120. int c_GrabButton(xd, xp)     
  121. XD *xd;
  122. XParams *xp;
  123.     XUngrabButton(xd->display, AnyButton, AnyModifier, xd->window);
  124. }
  125.  
  126. /* ====================================================================== */
  127.  
  128. int   UngrabButton(xd, xp)   
  129. XD *xd;
  130. XParams *xp;
  131. {
  132.     for (i = 0; i < xp-> itns; i ++)
  133.     XUngrabButton(xd->display, AnyButton, AnyModifier, xd->window);
  134. }
  135.  
  136. int i_UngrabButton(xd, xp)   
  137. XD *xd;
  138. XParams *xp;
  139. {
  140. }
  141.  
  142. int c_UngrabButton(xd, xp)   
  143. XD *xd;
  144. XParams *xp;
  145. {
  146. }
  147.  
  148. /* ====================================================================== */
  149.  
  150. int   ChangeActivePointerGrab(xd, xp)
  151. XD *xd;
  152. XParams *xp;
  153. {
  154.     for (i = 0; i < xp-> itns; i ++)
  155.     XChangeActivePointerGrab(xd->display, ButtonPress, None, CurrentTime);
  156. }
  157.  
  158. int i_ChangeActivePointerGrab(xd, xp)
  159. XD *xd;
  160. XParams *xp;
  161. { }
  162.  
  163. int c_ChangeActivePointerGrab(xd, xp)
  164. XD *xd;
  165. XParams *xp;
  166. { }
  167.  
  168. /* ====================================================================== */
  169.  
  170. int   GrabKeyboard(xd, xp)   
  171. XD *xd;
  172. XParams *xp;
  173. {
  174.     for (i = 0; i < xp-> itns; i ++)
  175.     XGrabKeyboard(xd->display, xd->window, True,
  176.             GrabModeAsync, GrabModeAsync, CurrentTime);
  177. }
  178.  
  179. int i_GrabKeyboard(xd, xp)   
  180. XD *xd;
  181. XParams *xp;
  182. { }
  183.  
  184. int c_GrabKeyboard(xd, xp)   
  185. XD *xd;
  186. XParams *xp;
  187.     XUngrabKeyboard(xd->display, CurrentTime);
  188. }
  189.  
  190. /* ====================================================================== */
  191.  
  192. int   UngrabKeyboard(xd, xp) 
  193. XD *xd;
  194. XParams *xp;
  195. {
  196.     for (i = 0; i < xp-> itns; i ++)
  197.     XUngrabKeyboard(xd->display, CurrentTime);
  198. }
  199.  
  200. int i_UngrabKeyboard(xd, xp) 
  201. XD *xd;
  202. XParams *xp;
  203. { }
  204.  
  205. int c_UngrabKeyboard(xd, xp) 
  206. XD *xd;
  207. XParams *xp;
  208. { }
  209.  
  210. /* ====================================================================== */
  211.  
  212. int   GrabKey(xd, xp)        
  213. XD *xd;
  214. XParams *xp;
  215. {
  216.     for (i = 0; i < xp-> itns; i ++)
  217.      XGrabKey(xd->display, AnyKey, AnyModifier, xd->window, True, 
  218.           GrabModeAsync, GrabModeAsync);
  219. }
  220.  
  221. int i_GrabKey(xd, xp)        
  222. XD *xd;
  223. XParams *xp;
  224. { }
  225.  
  226. int c_GrabKey(xd, xp)        
  227. XD *xd;
  228. XParams *xp;
  229. {
  230.     XUngrabKey(xd->display, AnyKey, AnyModifier, xd->window);
  231. }
  232.  
  233. /* ====================================================================== */
  234.  
  235. int   UngrabKey(xd, xp)      
  236. XD *xd;
  237. XParams *xp;
  238. {
  239.     for (i = 0; i < xp-> itns; i ++)
  240.      XUngrabKey(xd->display, AnyKey, AnyModifier, xd->window);
  241. }
  242.  
  243. int i_UngrabKey(xd, xp)      
  244. XD *xd;
  245. XParams *xp;
  246. { }
  247. int c_UngrabKey(xd, xp)      
  248. XD *xd;
  249. XParams *xp;
  250. { }
  251.  
  252. /* ====================================================================== */
  253.  
  254. int   AllowEvents(xd, xp)    
  255. XD *xd;
  256. XParams *xp;
  257. {
  258.     for (i = 0; i < xp-> itns; i ++)
  259.       XAllowEvents(xd->display, AsyncPointer, CurrentTime);
  260. }
  261.  
  262. int i_AllowEvents(xd, xp)    
  263. XD *xd;
  264. XParams *xp;
  265. { }
  266.  
  267. int c_AllowEvents(xd, xp)    
  268. XD *xd;
  269. XParams *xp;
  270. { }
  271.  
  272. /* ====================================================================== */
  273.  
  274. int   GrabServer(xd, xp)     
  275. XD *xd;
  276. XParams *xp;
  277. {
  278.     for (i = 0; i < xp-> itns; i ++)
  279.       XGrabServer(xd->display);
  280. }
  281.  
  282. int i_GrabServer(xd, xp)     
  283. XD *xd;
  284. XParams *xp;
  285. { }
  286.  
  287. int c_GrabServer(xd, xp)     
  288. XD *xd;
  289. XParams *xp;
  290. {
  291.     XUngrabServer(xd->display);
  292. }
  293.  
  294. /* ====================================================================== */
  295.  
  296. int   UngrabServer(xd, xp)   
  297. XD *xd;
  298. XParams *xp;
  299. {
  300.     for (i = 0; i < xp-> itns; i ++)
  301.       XUngrabServer(xd->display);
  302. }
  303.  
  304. int i_UngrabServer(xd, xp)   
  305. XD *xd;
  306. XParams *xp;
  307. { }
  308.  
  309. int c_UngrabServer(xd, xp)   
  310. XD *xd;
  311. XParams *xp;
  312. { }
  313.  
  314. /* ====================================================================== */
  315.  
  316. int   QueryPointer(xd, xp)   
  317. XD *xd;
  318. XParams *xp;
  319. {
  320.     Window rw, cw;
  321.     int xw, yw, xr, yr;
  322.     unsigned int keys_buttons;
  323.  
  324.     for (i = 0; i < xp-> itns; i ++)
  325.     XQueryPointer(xd->display, DefaultRootWindow(xd->display), &rw, &cw,
  326.         &xw, &yw, &xr, &yr, &keys_buttons);
  327. }
  328. int i_QueryPointer(xd, xp)   
  329. XD *xd;
  330. XParams *xp;
  331. { }
  332. int c_QueryPointer(xd, xp)   
  333. XD *xd;
  334. XParams *xp;
  335. { }
  336.  
  337. /* ====================================================================== */
  338. static XTimeCoord ** time_coord;
  339.  
  340. int   GetMotionEvents(xd, xp)
  341. XD *xd;
  342. XParams *xp;
  343. {
  344.   int nevents;
  345.  
  346.   for (i = 0; i < xp-> itns; i ++) 
  347.     time_coord[i] = XGetMotionEvents(xd->display, xd->window,
  348.                      CurrentTime, CurrentTime, &nevents);
  349. }
  350.  
  351. int i_GetMotionEvents(xd, xp)
  352. XD *xd;
  353. XParams *xp;
  354.   time_coord = (XTimeCoord **) malloc(sizeof(XTimeCoord *) * xp->itns);
  355. }
  356.  
  357. int c_GetMotionEvents(xd, xp)
  358. XD *xd;
  359. XParams *xp;
  360.   for (i = 0; i < xp-> itns; i ++)
  361.     if (time_coord[i]) XFree((caddr_t) time_coord[i]);
  362.   free(time_coord);
  363. }
  364.  
  365. /* ====================================================================== */
  366.  
  367. int   TranslateCoordinates(xd, xp)
  368. XD *xd;
  369. XParams *xp;
  370. {
  371.     int xpt, ypt, xjunk, yjunk;
  372.  
  373.     xpt = XPOSITION(xd->display, xd->screen) + 16;
  374.     ypt = YPOSITION(xd->display, xd->screen) + 16;
  375.  
  376.     for (i = 0; i < xp-> itns; i ++)
  377.     XTranslateCoordinates(xd->display, DefaultRootWindow(xd->display), 
  378.         DefaultRootWindow(xd->display), xpt, ypt, &xjunk, &yjunk, &window);
  379. }
  380.  
  381. int i_TranslateCoordinates(xd, xp)
  382. XD *xd;
  383. XParams *xp;
  384. { }
  385. int c_TranslateCoordinates(xd, xp)
  386. XD *xd;
  387. XParams *xp;
  388. { }
  389.  
  390. /* ====================================================================== */
  391.  
  392. int   WarpPointer(xd, xp)    
  393. XD *xd;
  394. XParams *xp;
  395. {
  396.     int dst_x, dst_y;
  397.  
  398.     for (i = 0; i < xp-> itns; i ++) {
  399.     if (i % 2)
  400.         dst_x = dst_y = 0;
  401.     else {
  402.         dst_x = DisplayWidth (xd->display, xd->screen);
  403.         dst_y = DisplayHeight(xd->display, xd->screen);
  404.     }
  405.     XWarpPointer(xd->display, None, DefaultRootWindow(xd->display),
  406.         0, 0, 0, 0, dst_x, dst_y);
  407.     }
  408. }
  409. int i_WarpPointer(xd, xp)    
  410. XD *xd;
  411. XParams *xp;
  412. { }
  413.  
  414. int c_WarpPointer(xd, xp)    
  415. XD *xd;
  416. XParams *xp;
  417. {
  418.     ParkPointer(xd);    /* Restore the pointer to initial parking */
  419. }
  420.  
  421. /* ====================================================================== */
  422.  
  423. int   SetInputFocus(xd, xp)  
  424. XD *xd;
  425. XParams *xp;
  426. {
  427.   for (i = 0; i < xp-> itns; i ++)
  428.     XSetInputFocus(xd->display, xd->window, RevertToPointerRoot, CurrentTime);
  429. }
  430.  
  431. int i_SetInputFocus(xd, xp)
  432. XD *xd;
  433. XParams *xp;
  434. { }
  435.  
  436. int c_SetInputFocus(xd, xp)
  437. XD *xd;
  438. XParams *xp;
  439. {
  440.   XSetInputFocus(xd->display, DefaultRootWindow(xd->display),
  441.          RevertToPointerRoot, CurrentTime);
  442. }
  443.  
  444. /* ====================================================================== */
  445.  
  446. int   GetInputFocus(xd, xp)  
  447. XD *xd;
  448. XParams *xp;
  449. {
  450.   Window focus;
  451.   int    revert_to;
  452.  
  453.   for (i = 0; i < xp-> itns; i ++)
  454.     XGetInputFocus(xd->display, &focus, &revert_to);
  455. }
  456.  
  457. int i_GetInputFocus(xd, xp)  
  458. XD *xd;
  459. XParams *xp;
  460. { }
  461.  
  462. int c_GetInputFocus(xd, xp)  
  463. XD *xd;
  464. XParams *xp;
  465. { }
  466.  
  467. /* ====================================================================== */
  468.  
  469. int   QueryKeymap(xd, xp)    
  470. XD *xd;
  471. XParams *xp;
  472. {
  473.     char key_vector[32];
  474.     
  475.     for (i = 0; i < xp-> itns; i ++) 
  476.     XQueryKeymap(xd->display, key_vector);
  477. }
  478. int i_QueryKeymap(xd, xp)    
  479. XD *xd;
  480. XParams *xp;
  481. { }
  482. int c_QueryKeymap(xd, xp)    
  483. XD *xd;
  484. XParams *xp;
  485. { }
  486.  
  487. /* ====================================================================== */
  488.  
  489. int   CreateCursor(xd, xp)   
  490. XD *xd;
  491. XParams *xp;
  492. {
  493. /*    XCreatePixmapCursor(); */
  494. }
  495. int i_CreateCursor(xd, xp)   
  496. XD *xd;
  497. XParams *xp;
  498. {
  499. }
  500. int c_CreateCursor(xd, xp)   
  501. XD *xd;
  502. XParams *xp;
  503. {
  504. }
  505.  
  506. /* ====================================================================== */
  507.  
  508. int   CreateGlyphCursor(xd, xp)
  509. XD *xd;
  510. XParams *xp;
  511. {
  512. }
  513. int i_CreateGlyphCursor(xd, xp)
  514. XD *xd;
  515. XParams *xp;
  516. {
  517. /*   XCreateGlyphCursor(); */
  518. }
  519. int c_CreateGlyphCursor(xd, xp)
  520. XD *xd;
  521. XParams *xp;
  522. {
  523. }
  524.  
  525. /* ====================================================================== */
  526.  
  527. int   FreeCursor(xd, xp)     
  528. XD *xd;
  529. XParams *xp;
  530. {
  531. }
  532. int i_FreeCursor(xd, xp)     
  533. XD *xd;
  534. XParams *xp;
  535. {
  536. }
  537. int c_FreeCursor(xd, xp)     
  538. XD *xd;
  539. XParams *xp;
  540. {
  541. }
  542.  
  543. /* ====================================================================== */
  544.  
  545. int   RecolorCursor(xd, xp)  
  546. XD *xd;
  547. XParams *xp;
  548. {
  549. }
  550. int i_RecolorCursor(xd, xp)  
  551. XD *xd;
  552. XParams *xp;
  553. {
  554. }
  555. int c_RecolorCursor(xd, xp)  
  556. XD *xd;
  557. XParams *xp;
  558. {
  559. }
  560.  
  561. /* ====================================================================== */
  562.  
  563. int   QueryBestSize(xd, xp)  
  564. XD *xd;
  565. XParams *xp;
  566. {
  567.     unsigned int rwidth, rheight;
  568.  
  569.     for (i = 0; i < xp-> itns; i ++)
  570.     XQueryBestSize(xd->display, CursorShape, xd->window, 16, 16,
  571.                     &rwidth, &rheight);
  572. }
  573.  
  574. int i_QueryBestSize(xd, xp)  
  575. XD *xd;
  576. XParams *xp;
  577. { }
  578.  
  579. int c_QueryBestSize(xd, xp)  
  580. XD *xd;
  581. XParams *xp;
  582. { }
  583.  
  584. /* ====================================================================== */
  585.  
  586. int   QueryExtension(xd, xp) 
  587. XD *xd;
  588. XParams *xp;
  589. {
  590.     int major_opcode, first_event, first_error;
  591.     static char *name = "MIT_SHM";
  592.  
  593.     for (i = 0; i < xp-> itns; i ++)
  594.     XQueryExtension(xd->display, name, &major_opcode, 
  595.                 &first_event, &first_error);
  596. }
  597.  
  598. int i_QueryExtension(xd, xp) 
  599. XD *xd;
  600. XParams *xp;
  601. { }
  602.  
  603. int c_QueryExtension(xd, xp) 
  604. XD *xd;
  605. XParams *xp;
  606. { }
  607.  
  608. /* ====================================================================== */
  609. char ***extensions;
  610. int   ListExtensions(xd, xp) 
  611. XD *xd;
  612. XParams *xp;
  613. {
  614.     int nextensions;
  615.  
  616.     for (i = 0; i < xp-> itns; i ++)
  617.     extensions[i] = XListExtensions(xd->display, &nextensions);
  618. }
  619.  
  620. int i_ListExtensions(xd, xp) 
  621. XD *xd;
  622. XParams *xp;
  623. {
  624.     extensions = (char ***) malloc(sizeof(char **) * xp->itns);
  625. }
  626.  
  627. int c_ListExtensions(xd, xp) 
  628. XD *xd;
  629. XParams *xp;
  630. {
  631.     for (i = 0; i < xp-> itns; i ++)
  632.     XFree((caddr_t) extensions[i]);
  633.     free(extensions);
  634. }
  635.  
  636. /* ====================================================================== */
  637. static KeySym **keysyms;
  638. static KeySym  *keysym ;
  639. static int     keycode_count;
  640. static int     keysyms_per_keycode;
  641.  
  642. int   ChangeKeyboardMapping(xd, xp)
  643. XD *xd;
  644. XParams *xp;
  645. {
  646.     for (i = 0; i < xp-> itns; i ++)
  647.     XChangeKeyboardMapping( xd->display,xd->display->min_keycode,
  648.                 keysyms_per_keycode, keysym, keycode_count);
  649. }
  650.  
  651. int i_ChangeKeyboardMapping(xd, xp)
  652. XD *xd;
  653. XParams *xp;
  654. {
  655.     keycode_count = xd->display->max_keycode - xd->display->min_keycode + 1;
  656.     keysym = XGetKeyboardMapping( xd->display, xd->display->min_keycode,
  657.                   keycode_count, &keysyms_per_keycode);
  658. }
  659.  
  660. int c_ChangeKeyboardMapping(xd, xp)
  661. XD *xd;
  662. XParams *xp;
  663. {
  664.     XFree((caddr_t) keysym);
  665. }
  666.  
  667. /* ====================================================================== */
  668.  
  669. int   GetKeyboardMapping(xd, xp)
  670. XD *xd;
  671. XParams *xp;
  672. {
  673.     keycode_count = xd->display->max_keycode - xd->display->min_keycode + 1;
  674.     for (i = 0; i < xp-> itns; i ++)
  675.     keysyms[i] = XGetKeyboardMapping( xd->display,
  676.             xd->display->min_keycode, keycode_count,
  677.             &keysyms_per_keycode);
  678. }
  679.  
  680. int i_GetKeyboardMapping(xd, xp)
  681. XD *xd;
  682. XParams *xp;
  683. {
  684.     keysyms = (KeySym **) malloc(sizeof(KeySym *) * xp->itns);
  685. }
  686.  
  687. int c_GetKeyboardMapping(xd, xp)
  688. XD *xd;
  689. XParams *xp;
  690. {
  691.     for (i = 0; i < xp-> itns; i ++)
  692.     XFree((caddr_t) keysyms[i]);
  693.     free(keysyms);
  694. }
  695.  
  696. /* ====================================================================== */
  697.  
  698. int   ChangeKeyboardControl(xd, xp)
  699. XD *xd;
  700. XParams *xp;
  701. {
  702.  
  703.     for (i = 0; i < xp-> itns; i ++)
  704.     XChangeKeyboardControl(xd->display, kbd_cntl_mask, &kbd_cntl);
  705. }
  706.  
  707. int i_ChangeKeyboardControl(xd, xp)
  708. XD *xd;
  709. XParams *xp;
  710.     XGetKeyboardControl(xd->display, &kbd_state);
  711.     kbd_cntl.key_click_percent    = kbd_state.key_click_percent ;
  712.     kbd_cntl.bell_percent     = kbd_state.bell_percent ;
  713.     kbd_cntl.bell_pitch     = kbd_state.bell_pitch ;
  714.     kbd_cntl.bell_duration     = kbd_state.bell_duration ;
  715.  
  716.     kbd_cntl_mask = KBKeyClickPercent | KBBellPercent |
  717.                 KBBellPitch       | KBBellDuration ;
  718. }
  719.  
  720. int c_ChangeKeyboardControl(xd, xp)
  721. XD *xd;
  722. XParams *xp;
  723. { }
  724.  
  725. /* ====================================================================== */
  726.  
  727. int   GetKeyboardControl(xd, xp)
  728. XD *xd;
  729. XParams *xp;
  730. {
  731.     for (i = 0; i < xp-> itns; i ++)
  732.     XGetKeyboardControl(xd->display, &kbd_state);
  733. }
  734. int i_GetKeyboardControl(xd, xp)
  735. XD *xd;
  736. XParams *xp;
  737. { }
  738.  
  739. int c_GetKeyboardControl(xd, xp)
  740. XD *xd;
  741. XParams *xp;
  742. { }
  743.  
  744. /* ====================================================================== */
  745.  
  746. int   Bell(xd, xp)           
  747. XD *xd;
  748. XParams *xp;
  749. {
  750.     for (i = 0; i < xp-> itns; i ++)
  751.     XBell(xd->display, -100);    /* Ring silently !! */
  752. }
  753.  
  754. int i_Bell(xd, xp)           
  755. XD *xd;
  756. XParams *xp;
  757. { }
  758.  
  759. int c_Bell(xd, xp)           
  760. XD *xd;
  761. XParams *xp;
  762. { }
  763.  
  764. /* ====================================================================== */
  765.  
  766. int   ChangePointerControl(xd, xp)
  767. XD *xd;
  768. XParams *xp;
  769. {
  770.     for (i = 0; i < xp-> itns; i++)
  771.     XChangePointerControl(xd->display, ptr_cntl.do_a, ptr_cntl.do_t,
  772.             ptr_cntl.acc_num, ptr_cntl.acc_denom, ptr_cntl.thresh);
  773. }
  774.  
  775. int i_ChangePointerControl(xd, xp)
  776. XD *xd;
  777. XParams *xp;
  778. {
  779.     ptr_cntl.do_a = 0;
  780.     ptr_cntl.do_t = 0;
  781.     XGetPointerControl(xd->display, &ptr_cntl.acc_num,
  782.             &ptr_cntl.acc_denom,&ptr_cntl.thresh);
  783. }
  784.  
  785. int c_ChangePointerControl(xd, xp)
  786. XD *xd;
  787. XParams *xp;
  788. { }
  789.  
  790. /* ====================================================================== */
  791.  
  792. int   GetPointerControl(xd, xp)
  793. XD *xd;
  794. XParams *xp;
  795. {
  796.     for (i = 0; i < xp-> itns; i++)
  797.     XGetPointerControl(xd->display, &ptr_cntl.acc_num,
  798.                 &ptr_cntl.acc_denom,&ptr_cntl.thresh);
  799. }
  800.  
  801. int i_GetPointerControl(xd, xp)
  802. XD *xd;
  803. XParams *xp;
  804. { }
  805.  
  806. int c_GetPointerControl(xd, xp)
  807. XD *xd;
  808. XParams *xp;
  809. { }
  810.  
  811. /* ====================================================================== */
  812.  
  813. int   SetScreenSaver(xd, xp) 
  814. XD *xd;
  815. XParams *xp;
  816. {
  817.     for (i = 0; i < xp-> itns; i ++)
  818.        XSetScreenSaver(xd->display, screensaver.timeout, screensaver.interval,
  819.            screensaver.prefer_blanking, screensaver.allow_exposures);
  820. }
  821.  
  822. int i_SetScreenSaver(xd, xp) 
  823. XD *xd;
  824. XParams *xp;
  825. {
  826.    XGetScreenSaver(xd->display, &screensaver.timeout, &screensaver.interval,
  827.        &screensaver.prefer_blanking, &screensaver.allow_exposures);
  828. }
  829.  
  830. int c_SetScreenSaver(xd, xp) 
  831. XD *xd;
  832. XParams *xp;
  833. { }
  834.  
  835. /* ====================================================================== */
  836.  
  837. int   GetScreenSaver(xd, xp) 
  838. XD *xd;
  839. XParams *xp;
  840. {
  841.     for (i = 0; i < xp-> itns; i ++)
  842.        XGetScreenSaver(xd->display, &screensaver.timeout, &screensaver.interval,
  843.            &screensaver.prefer_blanking, &screensaver.allow_exposures);
  844. }
  845.  
  846. int i_GetScreenSaver(xd, xp) 
  847. XD *xd;
  848. XParams *xp;
  849. {
  850. }
  851.  
  852. int c_GetScreenSaver(xd, xp) 
  853. XD *xd;
  854. XParams *xp;
  855. {
  856. }
  857.  
  858. /* ====================================================================== */
  859.  
  860. int   ChangeHosts(xd, xp)    
  861. XD *xd;
  862. XParams *xp;
  863. {
  864. }
  865. int i_ChangeHosts(xd, xp)    
  866. XD *xd;
  867. XParams *xp;
  868. {
  869. }
  870. int c_ChangeHosts(xd, xp)    
  871. XD *xd;
  872. XParams *xp;
  873. {
  874. }
  875.  
  876. /* ====================================================================== */
  877. static XHostAddress **hosts;
  878.  
  879. int   ListHosts(xd, xp)      
  880. XD *xd;
  881. XParams *xp;
  882. {
  883.     int nhosts;
  884.     Bool state;
  885.  
  886.     for (i = 0; i < xp-> itns; i++)  
  887.     hosts[i] = XListHosts(xd->display, &nhosts, &state);
  888. }
  889.  
  890. int i_ListHosts(xd, xp)      
  891. XD *xd;
  892. XParams *xp;
  893. {
  894.     hosts = (XHostAddress **) malloc(sizeof(XHostAddress *) * xp->itns);
  895. }
  896.  
  897. int c_ListHosts(xd, xp)      
  898. XD *xd;
  899. XParams *xp;
  900. {
  901.     for (i = 0; i < xp-> itns; i ++)
  902.     XFree((caddr_t) hosts[i]);
  903.     free(hosts);
  904. }
  905.  
  906. /* ====================================================================== */
  907.  
  908. int   SetAccessControl(xd, xp)
  909. XD *xd;
  910. XParams *xp;
  911. {
  912. }
  913. int i_SetAccessControl(xd, xp)
  914. XD *xd;
  915. XParams *xp;
  916. {
  917. }
  918. int c_SetAccessControl(xd, xp)
  919. XD *xd;
  920. XParams *xp;
  921. {
  922. }
  923.  
  924. /* ====================================================================== */
  925.  
  926. int   SetCloseDownMode(xd, xp)
  927. XD *xd;
  928. XParams *xp;
  929. {
  930.     for (i = 0; i < xp-> itns; i ++)
  931.     XSetCloseDownMode(xd->display, DestroyAll);
  932. }
  933. int i_SetCloseDownMode(xd, xp)
  934. XD *xd;
  935. XParams *xp;
  936. { }
  937.  
  938. int c_SetCloseDownMode(xd, xp)
  939. XD *xd;
  940. XParams *xp;
  941. { }
  942.  
  943. /* ====================================================================== */
  944.  
  945. int   KillClient(xd, xp)     
  946. XD *xd;
  947. XParams *xp;
  948. {
  949. }
  950. int i_KillClient(xd, xp)     
  951. XD *xd;
  952. XParams *xp;
  953. {
  954. }
  955. int c_KillClient(xd, xp)     
  956. XD *xd;
  957. XParams *xp;
  958. {
  959. }
  960.  
  961. /* ====================================================================== */
  962.  
  963. int   ForceScreenSaver(xd, xp)
  964. XD *xd;
  965. XParams *xp;
  966. {
  967.     for (i = 0; i < xp-> itns; i ++)
  968.     XForceScreenSaver(xd->display, ScreenSaverReset);
  969. }
  970. int i_ForceScreenSaver(xd, xp)
  971. XD *xd;
  972. XParams *xp;
  973. { }
  974.  
  975. int c_ForceScreenSaver(xd, xp)
  976. XD *xd;
  977. XParams *xp;
  978. { }
  979.  
  980. /* ====================================================================== */
  981. #define  NUM_PTR_MAP 3
  982. static unsigned char ptr_map[NUM_PTR_MAP];
  983. static int    num_ptr_map;   /* Actual return value from XGetPointerMapping */
  984.  
  985. int   SetPointerMapping(xd, xp)
  986. XD *xd;
  987. XParams *xp;
  988. {
  989.     for (i = 0; i < xp-> itns; i ++)
  990.     XSetPointerMapping(xd->display, ptr_map, num_ptr_map);
  991. }
  992.  
  993. int i_SetPointerMapping(xd, xp)
  994. XD *xd;
  995. XParams *xp;
  996. {
  997.     num_ptr_map = XGetPointerMapping(xd->display, ptr_map, NUM_PTR_MAP);
  998. }
  999.  
  1000. int c_SetPointerMapping(xd, xp)
  1001. XD *xd;
  1002. XParams *xp;
  1003. { }
  1004.  
  1005. /* ====================================================================== */
  1006.  
  1007. int   GetPointerMapping(xd, xp)
  1008. XD *xd;
  1009. XParams *xp;
  1010. {
  1011.     for (i = 0; i < xp-> itns; i ++)
  1012.     XGetPointerMapping(xd->display, ptr_map, NUM_PTR_MAP);
  1013. }
  1014.  
  1015. int i_GetPointerMapping(xd, xp)
  1016. XD *xd;
  1017. XParams *xp;
  1018. { }
  1019.  
  1020. int c_GetPointerMapping(xd, xp)
  1021. XD *xd;
  1022. XParams *xp;
  1023. { }
  1024.  
  1025. /* ====================================================================== */
  1026. static XModifierKeymap **modifier_key_maps;
  1027. static XModifierKeymap  *modifier_key_map;
  1028.  
  1029. int   SetModifierMapping(xd, xp)
  1030. XD *xd;
  1031. XParams *xp;
  1032. {
  1033.     for (i = 0; i < xp-> itns; i ++) 
  1034.     XSetModifierMapping(xd->display, modifier_key_map);
  1035. }
  1036.  
  1037. int i_SetModifierMapping(xd, xp)
  1038. XD *xd;
  1039. XParams *xp;
  1040. {
  1041.     modifier_key_map = XGetModifierMapping(xd->display);
  1042. }
  1043.  
  1044. int c_SetModifierMapping(xd, xp)
  1045. XD *xd;
  1046. XParams *xp;
  1047. {
  1048.     XFree((caddr_t) modifier_key_map);
  1049. }
  1050.  
  1051. /* ====================================================================== */
  1052.  
  1053. int   GetModifierMapping(xd, xp)
  1054. XD *xd;
  1055. XParams *xp;
  1056. {
  1057.     for (i = 0; i < xp-> itns; i ++) 
  1058.     modifier_key_maps[i] = XGetModifierMapping(xd->display);
  1059. }
  1060.  
  1061. int i_GetModifierMapping(xd, xp)
  1062. XD *xd;
  1063. XParams *xp;
  1064. {
  1065.     modifier_key_maps = (XModifierKeymap **) malloc(sizeof(XModifierKeymap *) *
  1066.                              xp->itns);
  1067. }
  1068.  
  1069. int c_GetModifierMapping(xd, xp)
  1070. XD *xd;
  1071. XParams *xp;
  1072. {
  1073.     for (i = 0; i < xp-> itns; i ++)
  1074.     XFree((caddr_t) modifier_key_maps[i]);
  1075.     free(modifier_key_maps);
  1076. }
  1077.  
  1078. /* ====================================================================== */
  1079.  
  1080. int   NoOperation(xd, xp)    
  1081. XD *xd;
  1082. XParams *xp;
  1083. {
  1084.     for (i = 0; i < xp-> itns; i ++)
  1085.         XNoOp(xd->display);
  1086. }
  1087.  
  1088. int i_NoOperation(xd, xp)    
  1089. XD *xd;
  1090. XParams *xp;
  1091. { }
  1092.  
  1093. int c_NoOperation(xd, xp)    
  1094. XD *xd;
  1095. XParams *xp;
  1096. { }
  1097.  
  1098. /* ====================================================================== */
  1099.